Chris Pollett > Old Classes >
CS175

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












HW#3 --- last modified February 07 2019 04:23:45..

Solution set.

Due date: Oct 31

Files to be submitted:
  Hw3.zip

Purpose:

Related Course Outcomes:

LO2 -- Write a mobile application that involves GUI components and makes use of touch events to manipulate these components.

LO3 -- Write a mobile application that uses the mobile devices Networking or Telephony APIs.

Specification:

In this modern age, the old maxim "The pen is mightier than the sword" ought to be replaced with the texting thumb or fingers are mightier than the sword. Therefore, it is important to maintain the health and linguistic readiness of our digits. For this homework you are tasked with creating a fitness tracker for your fingers. As a first step you should come up with three yoga or martial arts inspired finger exercises. For example, the "frog" is an exercise where your finger pretends to be a frog's tongue and zaps out and tries to tap as many flies as possible in a 20 second period which appear on the screen in random locations. You should have a readme.txt file in your project ZIP file with a delightfully entertaining description of each exercise (how to do it on the phone) and its origin story. For this assignment you will need to write both an app for a device as well as a server that runs on a machine somewhere (your laptop or desktop or a dedicated server elsewhere if you like). The server keeps track of users of your app and statistics about how they are doing in their exercise program. This server should be in a file FingerciseServer.java, which when run listens on port 7890. When a connection is established to your server, it sends to its output stream:

Fingercise Server

Your phone app can then send the server one of three kinds of messages: (1) a register name message, (2) send game result, (3) get statistics. For (1) and (2) the server responds either "Okay\n" if the action was successfully applied "Sorry\n" if it was not. It then terminates the connection. The format of each of the messages is a single line terminated by a newline character. More specifically, a register message looks like:

register:Bobby Smith

i.e., Register:some_name followed by a new line. Okay should be returned if your program succeeds in storing (some_name, 0) in an HashMap members, a field of your server class. Otherwise, it should return Sorry. It might return Sorry if someone has already registered with that name.

A game result message has the format:

result:player_name\tgame_name\tscore

For example:

result:Bobby Smith	frog	20

The results should be stored into a data structure of your app along with the time of when the message was sent. A statistics message has the format:

statistics:player_name

For example,

statistics:Bobby Smith

For this kind of message, the server responds with a sequence of lines. The last of these lines consists of a single period followed by a newline. A given line has the format:

game_name\tuser_high_score\tover_all_high_score\tover_all_avg_score\tuser_avg_score_last_hour\tuser_avg_score_last_week\tuser_avg_score_last_month

Here user_ scores are for that particular user, over_all scores are for all users of the app. For example, a response might look like:

frog	20	35	17	16	14	12
the pollinator	90	150	80	75	62	57
independent antennae 3	5	4	2	1	1
.

Your app only needs to support portrait mode, but it is okay if it supports other orientations. When your app is launched it should check if there is a current user. If there is, it should display an inspiration message for 5 seconds which disappears thereafter. This message should be calculated after making a statistics request to the server and should be based on personal progress the user is making as well as how the user compares to overall users. If there is no current user, your app should launch in a set user mode to get a user first and last name. Otherwise, the launch screen should have three buttons on it which allow a user to start each of the three finger exercises you will create. At the bottom of the screen should be a bar which allows the user to switch between exercise mode, set user mode, and statistics mode (until an initial name is set only set user mode in this bar works). Exercise mode is the mode with the three buttons on it that allow the user to start and play an exercise. When the user is done playing an exercise, their score should be sent to the server. Set user mode should show a view where the user can enter their first and last name and set that persistently in the app. Saving the user should also send a register message to the server. Statistics mode should display in a nice fashion the results of a statistics request.

Some of your Cinequest score will be available at the same time that this homework is due. On the Android and iOS github account there is a Issue tracker. On the trackers pages I will list issues that need to be resolved for each app. If you want to do an issue, comment in the issue that your team wants to do it, then using the assignee flag next to the issue at least one member of your team should claim the issue. From the date you claim an issue you have one week to make a pull request with some code resolving it. If I accept your pull request you get 3pts (this might take a couple of iterations). You can do as many issues as you like (your Cinequest score is 10pts but I will treat points above this as bonus points). If you don't do a pull request in one week anyone else is allowed to write their name next to the issue and try to resolve it.

Here are some reference screenshots of what the current apps look like:

2014 Cinequest iOS 2014 Cinequest Android

Below are the screenshots that Matt presented in class for this years UI:

For iOS:

News Tab Index By Event Tab Index By Film Tab Schedule Tab My Cinequest Tab

For Android:

Android News Tab Android Film Event Toggle AndroidFilms By Date

Point Breakdown

Coding Guidelines followed, code clean and well-documented 1pt
Readme.txt describes how to play each of the three games, lists all group members 1pt
FingerciseServer listens to port 7890 handles three kinds of messages as described (0.5 each) 2pts
Statistics-based inspirational message as described (0.5pts), statistics mode of the app as described (0.5pts) 1pt
Set User Mode saves user both persistently on device (0.5pts) and registers the user with the Fingercise server (0.5pts) 1pt
App exercise mode has three buttons (0.5pts) each of which lets a user do a finger exercise (1pt for each exercise). Saves results of doing an exercise on the server (0.5pts) 4pts
Total10pts